home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / GXMessages.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  7.5 KB  |  250 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        GXMessages.h
  3.  
  4.      Contains:    This file contains all of the public data structures,
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1994-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __GXMESSAGES__
  18. #define __GXMESSAGES__
  19.  
  20. #ifndef __CONDITIONALMACROS__
  21.     #include <ConditionalMacros.h>
  22. #endif
  23.  
  24. #ifndef __MACTYPES__
  25.     #include <MacTypes.h>
  26. #endif
  27.  
  28. #ifndef __MIXEDMODE__
  29.     #include <MixedMode.h>
  30. #endif
  31.  
  32.  
  33.  
  34.  
  35. #if PRAGMA_ONCE
  36. #pragma once
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46.  
  47. #if PRAGMA_STRUCT_ALIGN
  48.     #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50.     #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52.     #pragma pack(2)
  53. #endif
  54.  
  55. #if defined(__MWERKS__) && TARGET_CPU_68K
  56.     #pragma push
  57.     #pragma pointers_in_D0
  58. #endif
  59.  
  60.  
  61. /*
  62.  
  63.     >>>>>> CONSTANTS <<<<<<
  64.  
  65. */
  66. /* Message Manager Trap */
  67. enum {
  68.     messageManagerTrap            = 0xABFB
  69. };
  70.  
  71.  
  72. /* Message Manager Error Result Codes */
  73. enum {
  74.     messageStopLoopingErr        = -5775,
  75.     cantDeleteRunningHandlerErr    = -5776,
  76.     noMessageTableErr            = -5777,
  77.     dupSignatureErr                = -5778,
  78.     messageNotReceivedErr        = -5799
  79. };
  80.  
  81.  
  82. /*
  83.     DATA TYPES
  84. */
  85. typedef CALLBACK_API_C( OSErr , MessageHandlerOverrideProcPtr )(long arg1, long arg2, long arg3, long arg4, long arg5, long arg6);
  86. typedef STACK_UPP_TYPE(MessageHandlerOverrideProcPtr)             MessageHandlerOverrideUPP;
  87. #if OPAQUE_UPP_TYPES
  88.     EXTERN_API(MessageHandlerOverrideUPP)
  89.     NewMessageHandlerOverrideUPP    (MessageHandlerOverrideProcPtr userRoutine);
  90.  
  91.     EXTERN_API(void)
  92.     DisposeMessageHandlerOverrideUPP    (MessageHandlerOverrideUPP userUPP);
  93.  
  94.     EXTERN_API(OSErr)
  95.     InvokeMessageHandlerOverrideUPP    (long                arg1,
  96.                                     long                    arg2,
  97.                                     long                    arg3,
  98.                                     long                    arg4,
  99.                                     long                    arg5,
  100.                                     long                    arg6,
  101.                                     MessageHandlerOverrideUPP userUPP);
  102.  
  103. #else
  104.     enum { uppMessageHandlerOverrideProcInfo = 0x0003FFE1 };         /* 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  105.     #define NewMessageHandlerOverrideUPP(userRoutine)                 (MessageHandlerOverrideUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMessageHandlerOverrideProcInfo, GetCurrentArchitecture())
  106.     #define DisposeMessageHandlerOverrideUPP(userUPP)                 DisposeRoutineDescriptor(userUPP)
  107.     #define InvokeMessageHandlerOverrideUPP(arg1, arg2, arg3, arg4, arg5, arg6, userUPP)  (OSErr)CALL_SIX_PARAMETER_UPP((userUPP), uppMessageHandlerOverrideProcInfo, (arg1), (arg2), (arg3), (arg4), (arg5), (arg6))
  108. #endif
  109. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  110. #define NewMessageHandlerOverrideProc(userRoutine)                 NewMessageHandlerOverrideUPP(userRoutine)
  111. #define CallMessageHandlerOverrideProc(userRoutine, arg1, arg2, arg3, arg4, arg5, arg6) InvokeMessageHandlerOverrideUPP(arg1, arg2, arg3, arg4, arg5, arg6, userRoutine)
  112. typedef CALLBACK_API_C( void , MessageGlobalsInitProcPtr )(void *messageGlobals);
  113. typedef STACK_UPP_TYPE(MessageGlobalsInitProcPtr)                 MessageGlobalsInitUPP;
  114. #if OPAQUE_UPP_TYPES
  115.     EXTERN_API(MessageGlobalsInitUPP)
  116.     NewMessageGlobalsInitUPP       (MessageGlobalsInitProcPtr userRoutine);
  117.  
  118.     EXTERN_API(void)
  119.     DisposeMessageGlobalsInitUPP    (MessageGlobalsInitUPP    userUPP);
  120.  
  121.     EXTERN_API(void)
  122.     InvokeMessageGlobalsInitUPP       (void *                    messageGlobals,
  123.                                     MessageGlobalsInitUPP    userUPP);
  124.  
  125. #else
  126.     enum { uppMessageGlobalsInitProcInfo = 0x000000C1 };             /* no_return_value Func(4_bytes) */
  127.     #define NewMessageGlobalsInitUPP(userRoutine)                     (MessageGlobalsInitUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMessageGlobalsInitProcInfo, GetCurrentArchitecture())
  128.     #define DisposeMessageGlobalsInitUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  129.     #define InvokeMessageGlobalsInitUPP(messageGlobals, userUPP)     CALL_ONE_PARAMETER_UPP((userUPP), uppMessageGlobalsInitProcInfo, (messageGlobals))
  130. #endif
  131. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  132. #define NewMessageGlobalsInitProc(userRoutine)                     NewMessageGlobalsInitUPP(userRoutine)
  133. #define CallMessageGlobalsInitProc(userRoutine, messageGlobals)    InvokeMessageGlobalsInitUPP(messageGlobals, userRoutine)
  134. #if OLDROUTINENAMES
  135. typedef MessageHandlerOverrideProcPtr     MessageHandlerOverrideProc;
  136. typedef MessageGlobalsInitProcPtr         MessageGlobalsInitProc;
  137. #endif  /* OLDROUTINENAMES */
  138.  
  139. typedef struct OpaqueMessageHandler*     MessageHandler;
  140. typedef struct OpaqueMessageObject*     MessageObject;
  141. /*
  142.  
  143.     PUBLIC INTERFACES
  144.  
  145.     Message Handler API Routines
  146. */
  147. EXTERN_API_C( long )
  148. CountMessageHandlerInstances    (void)                                                        TWOWORDINLINE(0x7028, 0xABFB);
  149.  
  150. EXTERN_API_C( void *)
  151. GetMessageHandlerClassContext    (void)                                                        TWOWORDINLINE(0x7029, 0xABFB);
  152.  
  153. EXTERN_API_C( void *)
  154. SetMessageHandlerClassContext    (void *                    anyValue)                            TWOWORDINLINE(0x702A, 0xABFB);
  155.  
  156. EXTERN_API_C( void *)
  157. GetMessageHandlerInstanceContext (void)                                                        TWOWORDINLINE(0x702B, 0xABFB);
  158.  
  159. EXTERN_API_C( void *)
  160. SetMessageHandlerInstanceContext (void *                anyValue)                            TWOWORDINLINE(0x702C, 0xABFB);
  161.  
  162. EXTERN_API_C( OSErr )
  163. NewMessageGlobals                (long                     messageGlobalsSize,
  164.                                  MessageGlobalsInitUPP     initProc)                            TWOWORDINLINE(0x702D, 0xABFB);
  165.  
  166. EXTERN_API_C( void )
  167. DisposeMessageGlobals            (void)                                                        TWOWORDINLINE(0x702E, 0xABFB);
  168.  
  169.  
  170. /*
  171.     Message Sending API Routines
  172. */
  173. #ifndef BUILDING_GXMESSAGES
  174. EXTERN_API_C( OSErr )
  175. SendObjectMessage                (MessageObject             msgObject,
  176.                                  long                     messageSelector,
  177.                                  ...)                                                        FIVEWORDINLINE(0x205F, 0x221F, 0x702F, 0xABFB, 0x518F);
  178.  
  179. EXTERN_API_C( OSErr )
  180. SendObjectMessageTo                (MessageObject             msgObject,
  181.                                  long                     messageSelector,
  182.                                  MessageHandler         msgHandler,
  183.                                  ...)                                                        SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7030, 0xABFB, 0x9EFC, 0x000C);
  184.  
  185. EXTERN_API_C( OSErr )
  186. SendObjectMessageFor            (MessageObject             msgObject,
  187.                                  long                     messageSelector,
  188.                                  MessageHandler         msgHandler,
  189.                                  ...)                                                        SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7037, 0xABFB, 0x9EFC, 0x000C);
  190.  
  191. EXTERN_API_C( OSErr )
  192. StartObjectMessageAt            (MessageObject             msgObject,
  193.                                  long                     messageSelector,
  194.                                  MessageHandler         msgHandler,
  195.                                  ...)                                                        SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7031, 0xABFB, 0x9EFC, 0x000C);
  196.  
  197. #if TARGET_OS_MAC
  198.     #define MacSendMessage SendMessage
  199. #endif
  200. EXTERN_API_C( OSErr )
  201. MacSendMessage                    (long                     messageSelector,
  202.                                  ...)                                                        FOURWORDINLINE(0x221F, 0x7032, 0xABFB, 0x598F);
  203.  
  204. EXTERN_API_C( OSErr )
  205. SendMessageTo                    (long                     messageSelector,
  206.                                  MessageHandler         msgHandler,
  207.                                  ...)                                                        FIVEWORDINLINE(0x221F, 0x241F, 0x7033, 0xABFB, 0x518F);
  208.  
  209. EXTERN_API_C( OSErr )
  210. StartMessageAt                    (long                     messageSelector,
  211.                                  MessageHandler         msgHandler,
  212.                                  ...)                                                        FIVEWORDINLINE(0x221F, 0x241F, 0x7034, 0xABFB, 0x518F);
  213.  
  214. EXTERN_API_C( OSErr )
  215. ForwardMessage                    (long                     messageSelector,
  216.                                  ...)                                                        FOURWORDINLINE(0x221F, 0x7035, 0xABFB, 0x598F);
  217.  
  218. EXTERN_API_C( OSErr )
  219. ForwardThisMessage                (void *                    parameter1,
  220.                                  ...)                                                        TWOWORDINLINE(0x7036, 0xABFB);
  221.  
  222. #endif    /* BUILDING_GXMESSAGES */
  223.  
  224.  
  225. #if defined(__MWERKS__) && TARGET_CPU_68K
  226.     #pragma pop
  227. #endif
  228.  
  229.  
  230. #if PRAGMA_STRUCT_ALIGN
  231.     #pragma options align=reset
  232. #elif PRAGMA_STRUCT_PACKPUSH
  233.     #pragma pack(pop)
  234. #elif PRAGMA_STRUCT_PACK
  235.     #pragma pack()
  236. #endif
  237.  
  238. #ifdef PRAGMA_IMPORT_OFF
  239. #pragma import off
  240. #elif PRAGMA_IMPORT
  241. #pragma import reset
  242. #endif
  243.  
  244. #ifdef __cplusplus
  245. }
  246. #endif
  247.  
  248. #endif /* __GXMESSAGES__ */
  249.  
  250.